#include "inc/NetFileIO.h"

#include "inc/qd_datas.h"
#include "inc/qd_types.h"
#include "inc/qd_utils.h"

#include "NetFileIO.h"



NetFileIO::NetFileIO(int fd, int block)
    : mFd(fd), mBlockSize(block)   
{
  
}
    
// 从网络获取data, 写入到本地文件
int NetFileIO::Read(QCHAR *buff){

    int recvSize = recv(mFd, buff, mBlockSize, 0);

    return recvSize;
    
}


int NetFileIO::Write(QCHAR *buff, int len){
    int sendSize = send(mFd, buff, len, 0);

    return sendSize;
}
